import os
import unittest
from cases.Base_Case import BASECASE
from config.config import DATA_PATH
from page.index import IndexPage
from page.手术管理.麻醉申请.mazuishenqing__page import mazuishenqing
from tools.sjqd_way import read_data_from_excel
class TestMazuishenqing(BASECASE):
    @classmethod
    def setUpClass(cls):
        ap = IndexPage()
        ap.jrym_no1('麻醉申请')
    @classmethod
    def tearDownClass(cls):
        ap = IndexPage()
        ap.close_all_xxk()
        print("{}执行完毕-------------------------------------------------".format(cls))
    def test_mazuishenqing(self):
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "测试患者")
        name = self.data[0][0]
        bp = mazuishenqing()
        bp.input_name(name)
        bp.click_cx_btn()#点击查询按钮
        bp.click_sj1()#点击数据1
        bp.click_mzjlbj_btn()#点击编辑
        self.data = read_data_from_excel(os.path.join(DATA_PATH, "datas.xls"), "麻醉")
        zdys, mzys, sj1, sj2, sj3 = self.data[0]
        bp.fill_mzjl(zdys,mzys)#填写麻醉记录单
        bp.click_mzsf()#点击麻醉收费
        bp.add_sssfxm(2)
        bp.input_sj1(sj1)
        bp.input_sj2(sj2)
        bp.input_sj3(sj3)
        bp.click_mzjl_tjfy()  # 点击提交费用
        bp.click_mzjl()
        bp.click_mzjl_shbg()#点击审核报告
        bp.close_window()#关闭窗口

if __name__ == '__main__':
    unittest.main()
